<?php

namespace app\bussiness;
use thans\jwt\facade\JWTAuth;

class Bussiness
{
    /**
     * 形成token
     * @param $uid
     */
    public function jwt($uid){
        if(!is_numeric($uid)){
            return fail('参数格式不正确');
        }
        $token = JWTAuth::builder(['uid' => 1]);
        return $token;
    }

    /**
     * 验证token
     */
    public function check(){
        $res=JWTAuth::auth();
        if(!$res){
            return fail('token已失效');
        }

    }

}